<?php

class Application_Form_EditOffer extends Zend_Form
{

    public function init()
    {
         $this->setAction('/offers/edit/id/'.$this->_attribs['offerId']);
        
        $this->addElement('text','offeredPrice',array(
            'required'  => true,
            'validators'=> array('float'),
            'label'     => 'Cena wiązki'
        ));
        

        if($this->_attribs['first'] == 1) {
            $this->addElement('text','maxVolume',array(
                'required'=>true,
                'validators'=>array('int',array('greaterThan', false, array('min'=>0)),),
                'label'=>'Maksymalna liczba wiązek',
            ));
        } else {
            $this->addElement('hidden','maxVolume',array('value'=>1));
        }
        
        $this->addElement('submit','submit',array(
            'label'=>'Zatwierdź'
        ));
    }


}

